{% extends "base.html" %}

{% block content %}
<div class="row">
    <div class="col-md-12 mb-4">
        <h2>编辑个人档案</h2>
    </div>
</div>

<div class="row">
    <div class="col-md-8">
        <div class="card">
            <div class="card-header bg-primary text-white">
                <h5 class="mb-0">个人信息</h5>
            </div>
            <div class="card-body">
                <form action="" method="post" novalidate>
                    {{ form.hidden_tag() }}
                    <div class="mb-3">
                        {{ form.name.label(class="form-label") }}
                        {{ form.name(class="form-control") }}
                        {% for error in form.name.errors %}
                        <div class="text-danger">{{ error }}</div>
                        {% endfor %}
                    </div>
                    
                    <div class="mb-3">
                        {{ form.skills.label(class="form-label") }}
                        <select class="form-select" id="skills" name="skills" multiple>
                            {% for skill_id, skill_name in form.skills.choices %}
                            <option value="{{ skill_id }}" {% if skill_id in form.skills.data %}selected{% endif %}>{{ skill_name }}</option>
                            {% endfor %}
                        </select>
                        <div class="form-text">按住Ctrl键（Mac上为Command键）可以选择多个技能</div>
                        {% for error in form.skills.errors %}
                        <div class="text-danger">{{ error }}</div>
                        {% endfor %}
                    </div>
                    
                    <div class="d-grid">
                        {{ form.submit(class="btn btn-primary") }}
                    </div>
                </form>
            </div>
        </div>
    </div>
    
    <div class="col-md-4">
        <div class="card">
            <div class="card-header bg-primary text-white">
                <h5 class="mb-0">提示</h5>
            </div>
            <div class="card-body">
                <p>在这里您可以更新您的个人信息和技能标签。</p>
                <p>选择您掌握的技能标签，这将帮助其他成员了解您的专长领域。</p>
                <p>如果您需要的技能标签不在列表中，请联系管理员添加。</p>
            </div>
        </div>
    </div>
</div>
{% endblock %}

{% block scripts %}
<script>
    // 可以添加一些JavaScript来增强多选框的用户体验
    document.addEventListener('DOMContentLoaded', function() {
        // 这里可以添加一些增强功能，如搜索过滤等
    });
</script>
{% endblock %}